<template>
    <section>
    <!--顶部搜索工具条-->
    <el-card :span="24" class="toolbar" style="padding-bottom: 0px;">
      <el-form :inline="true" @submit.native.prevent>
        <el-form-item>
          <el-input v-model="filters.keyword" placeholder="请输入搜索内容"></el-input>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" @click="getUsers">查询</el-button>
        </el-form-item>
      </el-form>
    </el-card>

    <!--列表-->
    <el-table
      :data="users"
      v-loading="listLoading"
      @select="dialogCheck"
      @row-click="selectCurrentRow"
      ref="table"
      class="custom-tbl"
      style="width: 100%"
    >
      <el-table-column type="selection" width="50"> </el-table-column>
      <el-table-column prop="RealName" label="昵称" width="" sortable>
      </el-table-column>
      <el-table-column prop="LoginName" label="登录名" width="" sortable>
      </el-table-column>
      <el-table-column prop="RoleNames" label="角色" width="" sortable>
        <template #default="scope">
          <el-tag v-for="item in scope.row.RoleNames" :key="item.Id">{{
            item
          }}</el-tag>
        </template>
      </el-table-column>
      <el-table-column prop="DepartmentName" label="操作内容" width="" sortable>
      </el-table-column>
      <el-table-column
        prop="sex"
        label="操作时间"
        width=""
        :formatter="formatSex"
        sortable
      >
      </el-table-column>
    </el-table>

    <!--工具条-->
    <el-col :span="24" class="toolbar">
      <el-pagination
        layout="prev, pager, next"
        @current-change="handleCurrentChange"
        :page-size="50"
        :total="total"
        style="float: right"
      >
      </el-pagination>
    </el-col>
</section>
</template>

<script>
    import {getLogs} from '/@/api/log';

    export default {
        data() {
            return {
                filters: {
                    LinkUrl: ''
                },
                listLoading: true,
                tableData: [],
                t: ""
            }
        },
        methods: {
            getLogs() {
                this.listLoading = true;
                getLogs().then(response => {
                    this.tableData = response.data
                    this.listLoading = false
                })
            },
        },
        mounted() {
            this.getLogs();

        },
    }

</script>
